package framework.loadbalance;


import framework.rpc.protocol.register.RegisterUrl;

import java.util.List;
import java.util.Random;

/**
 * 负载均衡
 *
 * @author ldanniel
 */
public class LoadBalance {
    public static RegisterUrl loadUrl(List<RegisterUrl> urlList) {
        Random random = new Random();
        int i = random.nextInt(urlList.size());
        RegisterUrl registerUrl = urlList.get(i);
        return registerUrl;
    }
}
